<?php
namespace App\Http\Controllers;

use App\Models\Travelline;
use Illuminate\Support\Facades\Schema;

class TravellineController extends WxBaseController{
    protected $except=['index','show'];
    public function index($order='star'){
        $lines = Travelline::orderBy($order,'desc')->get();
        editImageUrl($lines);
        return $this->apiReturn(true,'success',$lines);
    }
    public function show($id){
        $line = Travelline::where('id',$id);
        //更新浏览量
        if(Schema::hasColumn('travellines', 'watch')){
            $line->increment('watch');
        };
        $arr = $line->get();
        editImageUrl($arr);
        return $this->apiReturn(true,'success',$arr);
    }
}